# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pcapteller
pkgver=1.1
pkgrel=6
groups=('blackarch' 'blackarch-sniffer' 'blackarch-networking')
pkgdesc='A tool designed for traffic manipulation and replay.'
arch=('any')
url='https://www.encripto.no/nb/downloads/tools/'
license=('BSD')
depends=('python2' 'python2-scapy' 'python2-ipcalc' 'python2-six')
makedepends=('git')
#source=("https://www.encripto.no/tools/$pkgname-$pkgver.tar.gz")
source=("git+https://github.com/BlackArch/$pkgname.git")
sha512sums=('SKIP')

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" docs/*

  rm -rf docs

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"

  rm -rf "$pkgdir/usr/share/pcapteller/libs/"*.pyc
}

